<?php

namespace common\libs;

class AES{
     
    private $tokenEncryptMode = 'AES-256-ECB';
    private $tokenEncryptKey = 'www.sell66.com';
    public function setKey($key) {
        $this->tokenEncryptKey = $key;
    }

    public function encode($data) {
    	return openssl_encrypt($data, $this->tokenEncryptMode, $this->tokenEncryptKey);
  	}
     
    public function decode($data) {
    	return  openssl_decrypt($data, $this->tokenEncryptMode, $this->tokenEncryptKey);
    }
}
?>
